package com.tengyun.middleplatform.trade.etl.task;

import com.tengyun.middleplatform.trade.etl.service.IDataHandleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * @Author: likailun
 * @Description: 数据清洗任务
 * @Date: create in 2022/3/7 2:35 下午
 */
@Component
@Slf4j
public class MainTask {

    @Resource
    private IDataHandleService dataHandleService;

    @Async
    @Scheduled(cron = "0 0 3 * * ?")
    public void mainTask(){
        log.info("定时任务执行——开始");
        dataHandleService.currentDayData(LocalDate.now().minusDays(1));
        log.info("定时任务执行——结束");
    }

}
